package ae.pcfc.etks.online.itworx.ehs.web.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.codehaus.jackson.annotate.JsonIgnore;

public class FNPFeesService implements Serializable{

	private String serviceId;
	private String serviceCode;
	private String arabicName;
	private String englishName;
	private int quantity=1;
	@JsonIgnore
	private String fullServiceName;
	private List<FNPFeesParameter> fnpParameters = new ArrayList<FNPFeesParameter>();

	public String getServiceId() {
		return serviceId;
	}

	public void setServiceId(String serviceId) {
		this.serviceId = serviceId;
	}

	public String getServiceCode() {
		return serviceCode;
	}

	public void setServiceCode(String serviceCode) {
		this.serviceCode = serviceCode;
	}

	public String getArabicName() {
		return arabicName;
	}

	public void setArabicName(String arabicName) {
		this.arabicName = arabicName;
	}

	public String getEnglishName() {
		return englishName;
	}

	public void setEnglishName(String englishName) {
		this.englishName = englishName;
	}
	public int getQuantity() {
		return quantity;
	}

	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}

	public List<FNPFeesParameter> getFnpParameters() {
		return fnpParameters;
	}

	public void setFnpParameters(List<FNPFeesParameter> fnpParameters) {
		this.fnpParameters = fnpParameters;
	}

	@Override
	public boolean equals(Object obj) {

		if (obj instanceof FNPFeesService) {
			FNPFeesService tobeCheckedAgaisnt = (FNPFeesService) obj;
			if (this.serviceId.equals(tobeCheckedAgaisnt.getServiceId())) {
				return true;
			}
			return false;

		} else {
			return false;
		}
	}
	
	public Map<String,FNPFeesParameter> getParameterMap()
	{
		Map<String,FNPFeesParameter> parameterMap=new HashMap<String, FNPFeesParameter>();
		
		for(FNPFeesParameter parameter:fnpParameters)
		{
			parameterMap.put(parameter.getName(), parameter);
		}
		
		return parameterMap;
	}

	public String getFullServiceName() {
		return serviceCode + " - " + englishName;
	}	
}
